package polymorphism;

/**
 * Created by admin on 2016-11-16.
 */
public class Persons {

    /**
     * 获取相关信息
     * @param person
     */
    public static void getInfo(Person person){
        System.out.println(person);
    }

    /**
     * 开会
     * @param persons
     */
    public static void meeting(Person... persons){


        for (Person person:persons){
            if(person.getClass() ==StudentLeader.class){
                ((StudentLeader)person).meeting();
            }
        }
    }

    public static void main(String[] args) {

        Student student=new Student("zx","male",20,"china","baida","110");
        Persons.getInfo(student);
        student.work();

        Worker worker=new Worker("zx","male",20,"china","ali",30);
        Persons.getInfo(worker);
        worker.work();

        StudentLeader studentLeader=new StudentLeader();
        Persons.getInfo(studentLeader);
        studentLeader.work();

        Persons.meeting(student,studentLeader);
    }

}
